onload = function(){
	var myC = document.getElementById('myCount');
	var b = document.getElementsByTagName('b')[0];
	var myCount_ul = document.getElementById('myCount_ul');

	myC.onmouseover = function(){
		myC.style.background = "#c7012c";
		myC.style.color = "#fff";
		b.style.backgroundImage = "url(images/red.jpg)";
		myCount_ul.style.display = "block";
	}
	myC.onmouseout = function(){
		myC.style.background = "";
		myC.style.color = "#666";
		b.style.backgroundImage = "url(images/sitenav.png)";
		myCount_ul.style.display = "none";
	}
	myCount_ul.onmouseover = function(){
		myC.style.background = "#c7012c";
		myC.style.color = "#fff";
		b.style.backgroundImage = "url(images/red.jpg)";
		myCount_ul.style.display = "block";
	}
	myCount_ul.onmouseout = function(){
		myC.style.background = "";
		myC.style.color = "#666";
		b.style.backgroundImage = "url(images/sitenav.png)";
		myCount_ul.style.display = "none";
	}
//------------登录----------------
	var welcome = document.getElementsByClassName("welcome")[0];
	var welto = document.getElementsByClassName("welto")[0];
	var safel = document.getElementsByClassName("safel")[0];
	var tojoin = document.getElementsByClassName("tojoin")[0];
	var fre = document.getElementsByClassName("fre")[0]; 
	var theuser = document.getElementById('theuser');
	var thepwd = document.getElementById("thepwd");
	var stru = getCookie("username");
	var strp = getCookie("password");
	//var strl = getCookie("userlogin");
	var login_btn = document.getElementsByClassName("login_btn")[0];
	login_btn.onclick = function(){
		if((theuser.value==stru)&&(thepwd.value==strp)){
			var userlogin=setCookie("userlogin",theuser.value,100);
		alert("恭喜您登陆成功");
		location.href="index.html";
		if(userlogin!=""){
		welto.innerHTML = "亲爱的";
		safel.innerHTML = userlogin;
		tojoin.innerHTML = "您好";
		fre.innerHTML = "";
		var a = document.createElement("a");
		welcome.appendChild(a);
		a.innerHTML = "[退出]";
		a.onclick = function(){
			setCookie("userlogin", "", -10);
				history.go(0);
		}
	}
		}
		
	}
	


}
	
	
	